﻿using EPSConverterLibrary;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace t_EPSConverterLibrary
{
    
    
    /// <summary>
    ///This is a test class for EPSRenderTest and is intended
    ///to contain all EPSRenderTest Unit Tests
    ///</summary>
    [TestClass()]
    public class EPSRenderTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Render
        ///</summary>
        [TestMethod()]
        public void RenderTest()
        {
            EPSRender target = new EPSRender(); // TODO: Initialize to an appropriate value
            string result = target.Render(new Uri("http://www-d0.fnal.gov/Run2Physics/WWW/results/prelim/TOP/T82/T82F1.eps"));
            Assert.AreEqual("<img src=\"C:\\Users\\gwatts\\AppData\\Local\\Temp\\T82F1.jpg\" />", result);
        }

        /// <summary>
        ///A test for CanRender
        ///</summary>
        [TestMethod()]
        public void CanRenderTest()
        {
            EPSRender target = new EPSRender(); // TODO: Initialize to an appropriate value
            Assert.IsFalse(target.CanRender(new Uri("http://www.nytimes.com")), "Web site should not render");
            Assert.IsFalse(target.CanRender(new Uri("http://www.nytimes.com/bogus.jpg")), "Picture should not render");
            Assert.IsTrue(target.CanRender(new Uri("http://www.nytimes.com/stuff.eps")), "EPS should render");
        }
    }
}
